//
// Project: Disagreement in science: Missing women




clear all
version 15.1  



//
// set locals, seed, etc
local treatment1 "conciliatory"
local treatment2 "aggressive"



//
// analysis

// 50-50 treatment
use "${data}/output/contest_experiment.dta", clear
tempname memhold
postfile `memhold' enforce female takeup lower upper using "${data}/temporary/figure_gap_task_money_5050.dta", replace
forvalues i=0/1 {  // enforce index
	forvalues j=0/1 {  // female index
		mean intro1playerlook if intro1playertreatment=="`treatment1'" & enforce==`i' & female==`j', level(90)
		matrix m = r(table)
		local mean = m[1,1]
		local lower = m[5,1]
		local upper = m[6,1]
		post `memhold' (`i') (`j') (`mean') (`lower') (`upper')
	}
}
postclose `memhold'
use "${data}/temporary/figure_gap_task_money_5050.dta", clear
generate bin = (1-enforce) + 1
replace bin = bin+0.4 if female==1
twoway (bar takeup bin if female==0, barwidth(0.35) color(gs3%80)) (bar takeup bin if female==1, barwidth(0.35) lcolor(gs6) fcolor(gs15%80)) (rcap lower upper bin, color(black)), yscale(r(0,1)) plotregion(style(none)) scheme(s1color) xtitle("") ytitle("Share of subjects who opt in") xlabel(0.5 " " 1.2 "Contest treatment" 2.2 "Deduct money treatment" 2.9 " ", noticks) ylabel(0 0.2 "0.2" .40 `"0.4"' 0.6 "0.6" .80 `"0.8"' 1 "1", grid angle(horizontal) labsize(medsmall)) legend(row(1) size(medsmall) order(1 "Male" 2 "Female") region(style(none)))
graph export "${output}/gap_task_money_5050.png", replace

// take $1 treatment
use "${data}/output/contest_experiment.dta", clear
tempname memhold
postfile `memhold' enforce female takeup lower upper using "${data}/temporary/figure_gap_task_money_take1.dta", replace
forvalues i=0/1 {  // enforce index
	forvalues j=0/1 {  // female index
		mean intro1playerlook if intro1playertreatment=="`treatment2'" & enforce==`i' & female==`j', level(90)
		matrix m = r(table)
		local mean = m[1,1]
		local lower = m[5,1]
		local upper = m[6,1]
		post `memhold' (`i') (`j') (`mean') (`lower') (`upper')
	}
}
postclose `memhold'
use "${data}/temporary/figure_gap_task_money_take1.dta", clear
generate bin = (1-enforce) + 1
replace bin = bin+0.4 if female==1
twoway (bar takeup bin if female==0, barwidth(0.35) color(gs3%80)) (bar takeup bin if female==1, barwidth(0.35) lcolor(gs6) fcolor(gs15%80)) (rcap lower upper bin, color(black)), yscale(r(0,1)) plotregion(style(none)) scheme(s1color) xtitle("") ytitle("Share of subjects who opt in") xlabel(0.5 " " 1.2 "Contest treatment" 2.2 "Deduct money treatment" 2.9 " ", noticks) ylabel(0 0.2 "0.2" .40 `"0.4"' 0.6 "0.6" .80 `"0.8"' 1 "1", grid angle(horizontal) labsize(medsmall)) legend(row(1) size(medsmall) order(1 "Male" 2 "Female") region(style(none)))
graph export "${output}/gap_task_money_take1.png", replace
